home *** CD-ROM | disk | FTP | other *** search
/ ...taking it to the Macs! / ...taking it to the Macs!.iso / Extras / ActiveX Mac SDK / ActiveX SDK / Control Common / CBaseControl.h < prev    next >
Text File  |  1996-12-17  |  3KB  |  99 lines

  1. // =================================================================================
  2. //
  3. //    CBaseControl.h                ©1996 Microsoft Corporation All rights reserved.
  4. //
  5. // =================================================================================
  6.  
  7. #ifndef _H_CBaseControl
  8. #define _H_CBaseControl
  9. #pragma once
  10.  
  11. class CBaseControl;
  12.  
  13. class CBaseContextInfo
  14. {
  15. public:
  16.     //  *** CBaseContextInfo methods ***
  17.                 CBaseContextInfo(CBaseControl* inControlP, Uint32 ContextID);
  18.     virtual     ~CBaseContextInfo(void);
  19.  
  20.     virtual ErrorCode    Update(Boolean8 Acquired);
  21.     virtual ErrorCode    Activate(Boolean8 Acquired);
  22.     virtual ErrorCode    Deactivate(Boolean8 Acquired);
  23.  
  24.     Uint32                GetContextID(void) { return mContextID; };
  25.  
  26. protected:
  27.     //  *** CBaseContextInfo members ***
  28.     Uint32                mContextID;
  29.     CBaseControl*        mControlP;
  30. };
  31.  
  32. class CBaseControl :
  33.     public CBaseCOM,
  34.     public IObjectWithSite,
  35.     public IControl,
  36.     public IPersistPropertyBag
  37. {
  38. public:
  39.     //  *** CBaseControl methods ***
  40.     CBaseControl(void);
  41.     virtual ~CBaseControl(void);
  42.  
  43.     //  *** IUnknown methods ***
  44.     STDMETHOD (QueryInterface)(REFIID inRefID, void** outObj);
  45.     STDMETHOD_ (Uint32, AddRef)(void) { return CBaseCOM::AddRef(); }
  46.     STDMETHOD_ (Uint32, Release)(void) { return CBaseCOM::Release(); }
  47.  
  48.     // *** IObjectWithSite methods ***
  49.     STDMETHOD (SetSite)(THIS_ IUnknown* inUnkSite);
  50.     STDMETHOD (GetSite)(THIS_ REFIID inRefID, void** outSite);
  51.  
  52.     // *** IControl methods ***
  53.     STDMETHOD (Draw) (THIS_ DrawContext* inContext);
  54.     STDMETHOD (OnContextChange)(THIS_ UInt32 inContextID, ContextCommand inCommand);
  55.     STDMETHOD (GetID)(THIS_ Int32 inBufferSize, Char8* outID);
  56.     STDMETHOD (GetUsedArea)(THIS_ PlatformRegion* outUsedArea);
  57.     STDMETHOD (SetFocus)(THIS_ FocusCommand inCommand, FocusSet inFocus);
  58.     STDMETHOD (DoMouse)(THIS_ MouseEventType inMouseET, PlatformEvent* inEvent);
  59.     STDMETHOD (DoKey)(THIS_ KeyEventType inKeyET, Char8 inChar, PlatformEvent* inEvent);
  60.     STDMETHOD (DoActivate)(THIS_ ActivateEventType inActiveET, UInt32 inContextID, PlatformEvent* inEvent);
  61.     STDMETHOD (DoSystemEvent)(THIS_ PlatformEvent* inEvent);
  62.     STDMETHOD (DoIdle)(THIS_ Uint32 IdleRefCon) ;
  63.  
  64.     //  *** IPersist methods ***
  65.     STDMETHOD (GetClassID)(CLSID* ClassID);
  66.  
  67.     //  *** IPersistPropertyBag methods ***
  68.     STDMETHOD (InitNew)(void);
  69.     STDMETHOD (Load)(IPropertyBag* PropertyBag, IErrorLog* ErrorLog);
  70.     STDMETHOD (Save)(IPropertyBag* PropertyBag, BOOL ClearDirty, BOOL SaveAllProperties);
  71.  
  72. protected:
  73.     //  *** CBaseControl methods ***
  74.     virtual Boolean8    StartIdling(void);
  75.     virtual Boolean8    StopIdling(void);
  76.     virtual CBaseContextInfo*    NewContext(Uint32 inContextID);
  77.     
  78.     void                 InvalAllContexts(void);
  79.     Boolean8            GetContextID(Int16 Index, Uint32* outContextID);
  80.     CBaseContextInfo*    GetContextInfoByID(Uint32 inContextID);
  81.     CBaseContextInfo*    GetContextInfoByIndex(Int16 inIndex);
  82.  
  83.     //  *** CBaseControl member variables ***
  84.     IUnknown*             mUnkOuterP;          
  85.     IContainerSite*     mContainerSiteP;
  86.     IContainer*            mContainerP;
  87.  
  88.     PlatformPoint        mSize;
  89.     Str255                mID;
  90.     Uint16                mActive : 1;
  91.  
  92.     CBaseContextInfo*    mActiveContext;        // Currently Active Context
  93.     LArray*                mContextInfo;        // list of contexts for this control & its control info
  94.  
  95.     IConnectionPointContainer*    mCPContainerP;    // Connection point container
  96. };
  97.  
  98. #endif
  99.